
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        List<Integer> integers=new ArrayList<>();
        String numbers=scanner.nextLine();
        System.out.println(numbers);
        String[] split=numbers.split(" ");
        int max=Integer.MIN_VALUE;
        //得到字符串们后
        int[] dp=new int[split.length];
        for (int i = 0; i < split.length; i++) {
            int num = Integer.parseInt(split[i]);
            if(i==0||i==1){
                dp[i]=num;
                if(i==1){
                    dp[i]=Math.max(num,dp[0]);
                }
                max=Math.max(dp[i],max);
            }else {
                //dp[i]可以拿dp[i-2]+split[i] 或者直接使用dp[i-1]
                dp[i]=Math.max(dp[i-2]+num,dp[i-1]);
                max=Math.max(dp[i],max);
            }
        }
        System.out.println(max);

    }
}